package com.ylr.jwt.common.exception;

import com.ylr.jwt.common.enums.JwtResultEnum;
import io.jsonwebtoken.JwtException;
import lombok.Getter;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wyw
 * date: 2023-04-26 15:16:57
 * className: CheckJwtException 校验jwt令牌异常类
 * version: 1.0
 * description:
 */
@Getter
public class CheckJwtException extends JwtException {

    private final Integer code;

    public CheckJwtException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public CheckJwtException(JwtResultEnum jwtResultEnum) {
        super(jwtResultEnum.getMsg());
        this.code = jwtResultEnum.getCode();
    }
}
